<script>
	export default {
    globalData: {
      statusBar:0,
      titTop:0,
      titHeight:0
    },
		onLaunch: function() {
      this.initLayoutData()      
      console.log('App Launch')
      //setInterval(()=>{
      //  uni.$emit('mqttMsg', { data: new Date()})
      //},3000)
		},
		onShow: function() { 
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
    methods: {
      initLayoutData(){
        // #ifdef H5
          this.globalData.titTop = 5;
          this.globalData.titHeight = 40;
        // #endif
        // #ifndef H5
          var _windowInfo = uni.getWindowInfo();
          this.globalData.statusBar = _windowInfo.statusBarHeight;
          // #ifdef APP-PLUS
            this.globalData.titTop = 5;
            this.globalData.titHeight = 40; 
          // #endif
          // #ifndef APP-PLUS
            var _menuButtonInfo = uni.getMenuButtonBoundingClientRect();
            if(_menuButtonInfo && _menuButtonInfo.top){
              this.globalData.titTop = Math.round(_menuButtonInfo.top) - this.globalData.statusBar;
              this.globalData.titHeight = Math.round(_menuButtonInfo.height);
            }else{
              this.globalData.titTop = 42 - this.globalData.statusBar;
              this.globalData.titHeight = 30;
            }
          // #endif
        // #endif
      }
    }    
	}
</script>

<style>
page{ background: #fff;}
.flex-x{display:flex; flex-flow:row nowrap; align-items:center}
.flex-xm{display:flex;flex-flow:row wrap}
.flex-yh{display:flex; flex-flow:column nowrap; height:100vh; overflow: hidden;}
.flex-y{display:flex; flex-flow:column nowrap}
/***
::-webkit-scrollbar {width:0; height: 0; color: transparent; display: none;}
***/
</style>
